Fluent Assertions Documentation
FluentAssertions Namespace / AsyncAssertionsExtensions Class / WithResult Method / WithResult<T>(Task<AndWhichConstraint<GenericAsyncFunctionAssertions<T>,T>>,T,String,Object[]) Method
The FluentAssertions.Specialized.GenericAsyncFunctionAssertions<TResult> containing the Task.
The expected value.
A formatted phrase as is supported by System.String.Format(System.String,System.Object[]) explaining why the assertion is needed. If the phrase does not start with the word because, it is prepended automatically.
Zero or more objects to format using the placeholders in because.
In This Topic
    WithResult<T>(Task<AndWhichConstraint<GenericAsyncFunctionAssertions<T>,T>>,T,String,Object[]) Method
    In This Topic
    Asserts that the completed Task provides the specified result.
    Syntax

    Parameters

    task
    The FluentAssertions.Specialized.GenericAsyncFunctionAssertions<TResult> containing the Task.
    expected
    The expected value.
    because
    A formatted phrase as is supported by System.String.Format(System.String,System.Object[]) explaining why the assertion is needed. If the phrase does not start with the word because, it is prepended automatically.
    becauseArgs
    Zero or more objects to format using the placeholders in because.

    Type Parameters

    T
    Remarks
    Please note that this assertion cannot identify whether the previous assertion was successful or not. In case it was not successful and it is running within an active FluentAssertions.Execution.AssertionScope there is no current result to compare with. So, this extension will compare with the default value.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also